<?php
/**
 * User: b179a9
 * Date: 10/12/11
 * Time: 4:45 PM
 */

namespace Managers;

class Genders extends BaseManager
{

    const TABLE = '\Catalog\Genders';
    protected $__table = self::TABLE;

    const TIME_IN_CACHE = 6000;

    public function getList()
    {
        $cacheName = 'genders';

        $res = $this->_getCacheManager()->load($cacheName);

        if (!$res) {
            $res = $this->_em->createQueryBuilder()
                    ->select('g')
                    ->from($this->__table, 'g')
                    ->getQuery()
                    ->getArrayResult();
            $this->_getCacheManager()->save($res, $cacheName, array('genders'), self::TIME_IN_CACHE);
        }
        return $res;
    }

}
